package com.vinaprime.primeschedule.businesslayer;

import java.io.IOException;

import android.annotation.SuppressLint;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.vinaprime.primeschedule.databaselayer.DatabaseController_DL;

@SuppressLint("NewApi")
public class DatabaseController_BL {
	DatabaseController_DL myDbController;
	Context myContext;
	String myPath;
	
	public DatabaseController_BL(Context context, String path){
		this.myDbController = new DatabaseController_DL(context, path);
		this.myPath = path;
		this.myContext = context;
	}
	
	public Context getMyContext() {
		return myContext;
	}

	public void setMyContext(Context myContext) {
		this.myContext = myContext;
	}

	public String getMyPath() {
		return myPath;
	}

	public void setMyPath(String myPath) {
		this.myPath = myPath;
	}
	
	public String getDatabaseName()
	{
		return this.myDbController.getDatabaseName();
	}
	
	public int getDatabaseVersion()
	{
		return this.myDbController.getDatabaseVersion();
	}
	
	public void onCreate(SQLiteDatabase arg0) {
		this.myDbController.onCreate(arg0);
	}
	
	public boolean checkDatabaseExist() throws IOException
	{
		return this.myDbController.checkDatabaseExist(this.myPath);
	}
	public void copyDatabase() throws IOException{
		this.myDbController.copyDatabase(this.myPath);
	}
}
